package com.sws.models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "RoleForUser")
public class RoleForUser {
	
	//private static final long serialVersionUID = 8496087166598616020L;
	private String roleId;
	private String name;
	private User user;
	
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name = "ROLE_ID")
	public String getRoleId() {
		return roleId;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne
    @JoinColumn(name="USER_USER_ID")
	public User getUser() {
		return user;
	}
	
	

}
